import java.util.TimerTask;

public class LastTimeThread extends TimerTask{

	private MainFrame frame;
	private int minute;
	private int second;
	
	public LastTimeThread(MainFrame frame,int lastTime){
		this.frame = frame;
		minute = lastTime - 1;
		second = 60;
	}
	
	@Override
	public void run() {
				
				if(second == 0){
					if(minute == 0){
						frame.lblLastTime.setText("正在关机...");

						TimeUtil.closeWindows();
						
						this.cancel();
					}
					minute--;
					second = 60;
				}
				second--;
				frame.lblLastTime.setText(minute + "分 " + second + "秒");
	}

}
